// pages/answer/endAnswer/index.js
import {IMG_PATH} from "../../../config/index"
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    statusBarHeight:0,
    IMG_PATH:IMG_PATH,
    headUrl: `${IMG_PATH}/center/头像.png`,
    answer:[],
    num:0,
    score:0,
    userinfo:{},
    titleUrl: `${IMG_PATH}/answer/ydt.png`,
    bottomUrl: `${IMG_PATH}/answer/bot_cz.png`,
    leftFlowerUrl: `${IMG_PATH}/answer/lef_sz.png`,
    rightFlowerUrl: `${IMG_PATH}/answer/rig_sz.png`,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(app.globalData.answer,app.globalData.score)
    this.setData({
      statusBarHeight:wx.getSystemInfoSync()['statusBarHeight'],
      num:options.num,
      answer:app.globalData.answer,
      score:app.globalData.score,
      userinfo:wx.getStorageSync('userinfo'),
    })
  },
  /**
   * 返回上个页面
   */
  backClick(){
    wx.navigateBack()
  },
  toerr(){
    wx.navigateTo({
      url: '../errorAnswer/index',
    })
  },
  reopen(){
    wx.redirectTo({
      url: `/pages/firstpage/firstpage?isLogin=${0}`,
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})